import React from 'react'

export default [
  {
    title: '资产编码',
    align: 'center',
    dataIndex: 'zcCode',
    width: 100,
    sorter: (a, b) => {
      if (a.zcType === '0001' && b.zcType === '0002') {
        return -1
      }
      if (a.zcType === '0002' && b.zcType === '0001') {
        return 1
      }
      if (a.zcType === b.zcType) {
        return a.zcCode && a.zcCode.localeCompare(b.zcCode)
      }
    },
    sortDirections: ['descend', 'ascend'],
  },
  {
    title: '资产名称',
    align: 'center',
    sorter: (a, b) => {
      if (a.zcType === '0001' && b.zcType === '0002') {
        return -1
      }
      if (a.zcType === '0002' && b.zcType === '0001') {
        return 1
      }
      if (a.zcType === b.zcType) {
        return a.zcName && a.zcName.localeCompare(b.zcName)
      }
    },
    dataIndex: 'zcName',
    width: 130,
  },
  {
    title: '资产分类',
    align: 'center',
    width: 80,
    dataIndex: 'zcClassName',
  },
  {
    title: '资产类型',
    align: 'center',
    width: 80,
    dataIndex: 'zcTypeName',
  },
  {
    title: '所在位置',
    align: 'center',
    width: 100,
    dataIndex: 'zcSeatName',
  },
  {
    title: '使用人',
    align: 'center',
    width: 80,
    dataIndex: 'useOperatorName',
  },
  {
    title: '入库时间',
    align: 'center',
    width: 100,
    dataIndex: 'gmtRk',
  },
  {
    title: '状态',
    align: 'center',
    width: 70,
    dataIndex: 'statusName',
  },
]
